import React, { useEffect, useState } from 'react';
import { history } from 'umi';
import { NavBar, Space, Toast } from 'antd-mobile';

type Props = {};

export default function index({}: Props) {
  let [shuju, setshuju] = useState({});
  useEffect(() => {
    // console.log();
    setshuju(history.location.state);
  }, []);
  const back = () => {
    history.goBack();
  };

  return (
    <div>
      <NavBar onBack={back}>{shuju.title}</NavBar>
      <img src={shuju.img} alt="" style={{ width: '100%' }} />
      {shuju.title}
      <span style={{ color: 'red' }}>￥{shuju.price}</span>
    </div>
  );
}
